Options
The Options property box allows you to limit the number of times the Repeat activity can repeat.
Example: Bob wants his workflow to make two copies of a document. He adds a Repeat activity and places a Move Entry activity (configured to copy) inside it. Then he configures the Repeat activity so the Iteration token starts at one and configures the condition so the activity repeats twice. Show me what this looks like.
The Options property box offers an additional safeguard against runaway Repeat activities because it lets you limit the number of times the activity will repeat.
To configure Repeat Options
- Add the Repeat activity to your workflow definition by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- Select the activity in the Designer Pane.
- Under Options in the Properties Pane, configure the following.
- To limit the number of times the activity will repeat, select Limit number of repetitions to. Type or use the scroll box (up-and-down arrows) to configure how many times the activity can repeat before it ends and the workflow continues. Alternatively, click the token button (right arrow) to use tokens.
- Choose whether you want the activity to check its condition Before running contained activities or After running contained activities. If the condition is checked before the contained activities run, and the condition is initially satisfied, the activities inside the Repeat activity will be skipped. If the condition is checked after the contained activities run, the activities inside the Repeat activity will always run at least once, regardless of the condition.
- Under Start the Iteration token at, select what number the Iteration token will start at when it begins to count the number of times the Repeat activity has repeated. If you select 0, the first time the Repeat activity runs the Iteration token’s value will be zero. If you select 1, the first time the Repeat activity runs the Iteration token's value will be 1.
Note: You can configure an iteration limit for all Repeat activities in the Advanced Server Options in the Workflow Administration Console. However, limits specified in the Repeat activity's Options property box will be used instead of the limit specified in the Workflow Administration Console.
Tip: If you are using the Iteration token to index a multi-value token, you may want to select 1 because indexes start at 1 instead of zero.